import {HOTELLIST,HOTEL,HOTELUPDATE,HOTELDELETE,ROOMLIST,ROOMDELETE,ROOMRESTORE,ROOMUPDATE} from '@/services/api'
import {request, METHOD} from '@/utils/request'

/**
 * 获取酒店列表
 */
export async function getHotel(hotelId) {
    return request(HOTEL, METHOD.GET, {hotelId: hotelId})
}

/**
 * 获取酒店列表
 */
export async function getHotelList(pageIndex, pageSize, params) {
    params.pageIndex = pageIndex
    params.pageSize = pageSize
    return request(HOTELLIST, METHOD.POST, params)
}

/**
 * 保存酒店信息
 * @param params
 * @returns {Promise<*>}
 */
export async function updateHotel(params) {
    return request(HOTELUPDATE, METHOD.POST, params)
}

/**
 * 删除酒店信息
 * @param params
 * @returns {Promise<*>}
 */
export async function deleteHotel(hotelId) {
    return request(HOTELDELETE, METHOD.GET, {hotelId: hotelId})
}

/**
 * 删除酒店信息
 * @param params
 * @returns {Promise<*>}
 */
export async function getRoomList(hotelId) {
    return request(ROOMLIST, METHOD.GET, {hotelId: hotelId})
}

/**
 * 删除房型信息
 * @param params
 * @returns {Promise<*>}
 */
export async function deleteRooms(roomIds) {
    return request(ROOMDELETE, METHOD.POST, roomIds)
}

/**
 * 恢复房型信息
 * @param params
 * @returns {Promise<*>}
 */
export async function restoreRooms(roomIds) {
    return request(ROOMRESTORE, METHOD.POST, roomIds)
}

/**
 * 更新房型信息
 * @param params
 * @returns {Promise<*>}
 */
export async function updateRoom(params) {
    return request(ROOMUPDATE, METHOD.POST, params)
}
